package com.buyingtickets.service.impl;

import com.buyingtickets.dao.CarriageDao;
import com.buyingtickets.service.CarriageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author bwj
 * @date 2021/6/24 9:09
 */
@Service
public class CarriageServiceImpl implements CarriageService {
    @Autowired
    private CarriageDao carriageDao;

    @Override
    public boolean addCarriage(int trainid, int cid, int cnum) {
        if (trainid > 0 && cid > 0 && cnum > 0) {
            return carriageDao.addCarriage(trainid, cid, cnum);
        }
        return false;
    }

    @Override
    public int queryIdLast() {
        return carriageDao.queryIdLast();
    }
}
